-
Notifications
You must be signed in to change notification settings - Fork 839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[META] - Converted EuiCardGraphic
to TS + tests
#1751
Conversation
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
@@ -3,7 +3,7 @@ | |||
/// <reference path="./button/index.d.ts" /> | |||
/// <reference path="./call_out/index.d.ts" /> | |||
/// <reference path="./code/index.d.ts" /> | |||
/// <reference path="./combo_box/index.d.ts" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
combo_box was referenced twice here
All comments welcome |
src/components/card/card_graphic.tsx
Outdated
color = 'blue', | ||
}) => { | ||
// Set the svg gradient colors | ||
// @ts-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ts
complains here for posible undefined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to add a !
before the .start
, .end
, and .path
accesses -
const graphicStartColor: string = graphicColorsToCodes.find(
w => w.color === color
)!.start;
The !
assures Typescript the object does exist, while not suppressing any other potential errors with ts-ignore.
I've updated my PR to resolve conflicts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small nit pick
src/components/card/card_graphic.tsx
Outdated
color = 'blue', | ||
}) => { | ||
// Set the svg gradient colors | ||
// @ts-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to add a !
before the .start
, .end
, and .path
accesses -
const graphicStartColor: string = graphicColorsToCodes.find(
w => w.color === color
)!.start;
The !
assures Typescript the object does exist, while not suppressing any other potential errors with ts-ignore.
Thanks for putting this together! |
Cool, I didn't knew that trick. I will update the PR. Thanx. |
jenkins test this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM; I'll wait for CI to go green and then merge this in.
Summary
As per #1557, I converted the
EuiCardGraphic
to TS.Checklist